package com.wlz.consumer;

import com.wlz.api.DemoService;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author wlz
 * @date 2022-07-11  11:56 下午
 */
@Slf4j
@SpringBootApplication
public class DubboConsumerDemo {

    @Reference(version = "default")
    private DemoService demoService;

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(DubboConsumerDemo.class, args);

        DemoService demoService = context.getBean(DemoService.class);

        log.info(" demoService: {} ", demoService.sayHello("wlz 文良"));
    }
}
